package com.tensquare.user;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * Created by Administrator on 2021/5/26.
 * 添加配置类,配置所有访问地址都可以匿名访问
 */
@EnableWebSecurity
@Configuration
public class SecurityWebConfig  extends WebSecurityConfigurerAdapter{
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        //对一些请求url进行放行
        http.authorizeRequests()
                .antMatchers("/**").permitAll()
                .and().csrf().disable();


        super.configure(http);
    }
}
